package com.gomyb.redis.enable;

import com.gomyb.redis.RedisConfig;
import com.gomyb.redis.RedisServiceImpl;
import org.springframework.cloud.commons.util.SpringFactoryImportSelector;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.core.type.AnnotationMetadata;

/**
 * @author <a href="mailto:hellohesir@gmail.com">Mr_He</a>
 * 2019/8/26 16:26
 */
@Order(Ordered.HIGHEST_PRECEDENCE - 100)
public class EnableRedisImportSelector extends SpringFactoryImportSelector<EnableRedis> {

    @Override
    public String[] selectImports(AnnotationMetadata metadata) {
        return new String[]{RedisConfig.class.getName(), RedisServiceImpl.class.getName()};
    }

    @Override
    protected boolean isEnabled() {
        return true;
    }

}
